#include<iostream>

using namespace std;

int main(int argc, char *argv[])
{
	int num, tmp;
	int tmp_first, tmp_second;
	cout << "Enter a number" << endl;
	cin >> num;
	tmp = num;
	tmp_first = num%10;
	tmp = tmp/10;
	while(tmp/10 > 0)
	{
		cout << tmp << endl;
		tmp_second = tmp%10;
		if(tmp_second > tmp_first)
		{
			cout << "The number is not a serial number" << endl;
			return 1;
		}
		tmp_first = tmp_second;
		tmp = tmp/10;
	}
	cout << "The number is a serial number" << endl;
	return 0;

}
